// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3) 
// Source File Name:   Dialog.java

package com.kaylyn.item;

import com.kaylyn.util.Initializable;
import com.kaylyn.util.Resource;
import java.awt.EventQueue;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import javax.swing.ImageIcon;
import javax.swing.JLabel;

public class Dialog extends JLabel implements Initializable {

	public Dialog() {
		a = 1;
		b = 1;
		setSize(840, 560);
		setIcon(new ImageIcon(Resource.loadImage("32700.jpg")));
		setOpaque(true);
		dialogA = new JLabel();
		dialogA.setSize(300, 180);
		dialogA.setLocation(0, 0);
		dialogB = new JLabel();
		dialogB.setSize(250, 200);
		dialogB.setLocation(590, 360);
		gaIcon = new ImageIcon[ga.length];
		for (int i = 0; i < ga.length; i++)
			gaIcon[i] = new ImageIcon(Resource.loadImage(ga[i]));

		tanIcon = new ImageIcon[tan.length];
		for (int i = 0; i < tan.length; i++)
			tanIcon[i] = new ImageIcon(Resource.loadImage(tan[i]));

		kaylyn = new JLabel();
		kaylyn.setSize(100, 100);
		kaylyn.setLocation(280, 200);
		kaylyn.addMouseListener(new MouseAdapter() {

			public void mouseClicked(MouseEvent e) {
				EventQueue.invokeLater(new Runnable() {

					public void run() {
						dialogA.setIcon(gaIcon[a]);
						a++;
						a %= 5;
					}
				});
			}

		});
		arthur = new JLabel();
		arthur.setSize(100, 100);
		arthur.setLocation(640, 280);
		arthur.addMouseListener(new MouseAdapter() {

			public void mouseReleased(MouseEvent e) {
				EventQueue.invokeLater(new Runnable() {

					public void run() {
						dialogB.setIcon(tanIcon[b]);
						b++;
						b %= 6;
					}

				});
			}
		});
		clickA = new JLabel();
		clickA.setSize(126, 88);
		clickA.setLocation(350, 160);
		clickB = new JLabel();
		clickB.setSize(126, 88);
		clickB.setLocation(720, 250);
		
		add(dialogA);
        add(dialogB);
        add(kaylyn);
        add(arthur);
        add(clickA);
        add(clickB);
        clickA.setIcon(new ImageIcon(Resource.loadImage("click.png")));
        clickB.setIcon(new ImageIcon(Resource.loadImage("click.png")));
        dialogA.setIcon(gaIcon[0]);
        dialogB.setIcon(tanIcon[0]);
        
	}

	public void start() {
		//setVisible(true);
	}

	public void stop() {
	}

	private static final long serialVersionUID = 1L;
	private String ga[] = { "ga.png", "gaga.png", "gagaga.png", "gagagaga.png",
			"gagagagaga.png" };
	private String tan[] = { "xiaobaobao.png", "yaobaobao.png",
			"xiaotantan.png", "yaomaomao.png", "xiaoyaya.png", "aiyaya.png" };
	private JLabel dialogA;
	private JLabel dialogB;
	private ImageIcon gaIcon[];
	private ImageIcon tanIcon[];
	private JLabel kaylyn;
	private JLabel arthur;
	private JLabel clickA;
	private JLabel clickB;
	private int a;
	private int b;

}
